package com.compress4j.arithmetic;

import java.io.IOException;

/**
 * 
 * @author brunopierre4@yahoo.fr
 * Interface of an arithmetic encoder
 */
public interface ArithmeticEncoder {

	/**
	 * Encode a range<br>
	 * Implementation does not have to check that 0 <= start < end < total but the caller do
	 * @param start
	 * @param end
	 * @param max
     * @throws IOException exception from the encapsultated outputstream.
	 */
	void encode(int start, int end, int max) throws IOException;

	/** Close the coder, flushing all buffered bits and closing the underlying outputstream
     * @throws IOException exception from the encapsultated outputstream.
     */
	void close() throws IOException;

	/** propagate flush to the underlying outputstream
     * @throws IOException exception from the encapsultated outputstream.
     */
	void flush() throws IOException;

}